﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PhutoiTieu
{
   public class SET
    {
        private char[] att;
        public char[] Att
        {
            get
            {
                return att;
            }
            set 
            {
                att = value;
            }
        }
        public SET()
        { 
            att= null;
        }
        public SET(char[] a)
        {
            att = a;
        }
        public bool checkatt()// kiem tra tap hop co dung hay khong
        {
            foreach (char c in att)
            {
                if ((c > 'Z') || (c < 'A')) return false;
            }
            return true;
        }
        public bool check(char[] c) // kiem tra mang C co nam trong tap hop hay khong
        {
            foreach (char s in c)

                if (att.Contains(s) == false) return false;

            return true;
        }
        public void AddAtt( char[] c) // them 1 tap hop vào tập hợp
        {
            string temp=this.ToString();
            for (int i = 0; i < c.Length; i++)
                if(!temp.Contains(c[i]))
                        temp += c[i];
             att = temp.ToCharArray();
        }
        public override string ToString()
        {
            string t = "";
            for (int i = 0; i < att.Length; i++)
                t =t+ att[i];
            return string.Format("{0}", t);
        }
    }
}
